//
//  SWStatusBottomView.swift
//  MYSwiftWeiBo
//
//  Created by shingwai chan on 16/3/5.
//  Copyright © 2016年 ChanShingWai. All rights reserved.
//

import UIKit


class SWStatusBottomView: UIView {

    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpUI()
    }

    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func setUpUI() {
        
        addSubview(forwardButton)
        addSubview(commentButton)
        addSubview(likeButton)
        addSubview(separatorViewFirst)
        addSubview(separatorViewSecond)
        
        //约束
        let multipliedBy = 1 / 3.0
        //转发
        forwardButton.snp_makeConstraints { (make) -> Void in
            make.top.leading.bottom.equalTo(self)
            make.width.equalTo(self).multipliedBy(multipliedBy)
        }
        //评论
        commentButton.snp_makeConstraints { (make) -> Void in
            make.leading.equalTo(forwardButton.snp_trailing)
            make.top.bottom.equalTo(self)
            make.width.equalTo(self).multipliedBy(multipliedBy)
        }
        //赞
        likeButton.snp_makeConstraints { (make) -> Void in
            make.top.bottom.trailing.equalTo(self)
            make.leading.equalTo(commentButton.snp_trailing)
            make.width.equalTo(self).multipliedBy(multipliedBy)
        }
        //分割线1
        separatorViewFirst.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(forwardButton.snp_trailing)
            make.centerY.equalTo(forwardButton)
        }
        separatorViewSecond.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(commentButton.snp_trailing)
            make.centerY.equalTo(commentButton)
        }
        
    }
    
    //MARK: 懒加载
    //转发
    lazy var forwardButton: UIButton = UIButton(imageName: "timeline_icon_retweet", bkImageName: "timeline_card_bottom_background", title: "转发", font: 11)
    //评论
    lazy var commentButton: UIButton = UIButton(imageName: "timeline_icon_comment", bkImageName: "timeline_card_bottom_background", title: "评论", font: 11)
    //赞
    lazy var likeButton: UIButton = UIButton(imageName: "timeline_icon_unlike", title: "赞")
    //分割线
    lazy var separatorViewFirst: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    lazy var separatorViewSecond: UIImageView = UIImageView(image: UIImage(named: "timeline_card_bottom_line"))
    
    
}
